home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 3 / 003.d81 / rate exchange (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  6KB  |  221 lines

  1. 10 rem ascoreign lenurrency lenonversion (NULL)rogram by (NULL)ichael atn. chr$ranger
  2. 20 rem (NULL)ranslated for the lenommodore 64 by str$onna (NULL). (NULL)oody
  3. 30 :
  4. 40 rem set colors
  5. 50 :
  6. 60 poke53280,8:rem set border color to orange
  7. 70 poke53281,15:rem set background color to gray 3
  8. 80 poke53272,23: rem selects upper/lower case
  9. 90 printchr$(8):rem disables c/shift key
  10. 100 printchr$(144):rem set character color to black
  11. 110 :
  12. 120 :
  13. 130 rem dimension and read data statements
  14. 140 dimcu(1000),a$(1000),n$(20),m$(20)
  15. 150 forx=1to12:readn$(x):next
  16. 160 forx=1to11:readm$(x):next
  17. 170 :
  18. 180 rem goto title page & first screen
  19. 190 :
  20. 200 goto1050
  21. 210 :
  22. 220 rem calculations
  23. 230 :
  24. 240 printchr$(147)
  25. 250 print"    [208][204][197][193][211][197][160][215][193][201][212].  [196][207][201][206][199][160][195][193][204][195][213][204][193][212][201][207][206][211]."
  26. 260 ifm$="p"thenprint" [201][206][198][207][210][205][193][212][201][207][206][160][215][201][204][204][160][194][197][160][207][213][212][208][213][212][160][212][207][160][208][210][201][206][212][197][210]."
  27. 270 ifm$="p"thengosub1720
  28. 280 ifa=2ora=8thener=er/10
  29. 290 ifa=6thener=er/100
  30. 300 ifa=3thener=1/er
  31. 310 ifr$="b"then520
  32. 320 forx=1to9:cu(x)=x/er:gosub840:gosub930:next
  33. 330 forx=10to100step10:cu(x)=x/er:gosub840:gosub930:next
  34. 340 ifm$="p"thengosub1820:goto380
  35. 350 printchr$(147):printtab(2);n$(a)
  36. 360 printtab(2);c$;tab(16);"$"
  37. 370 printtab(2);:fori=1to17:print"-";:nexti:print
  38. 380 ifa=6andm$="p"thengosub2150:goto420
  39. 390 ifa=6thenforx=100to900step100:printtab(4);x;tab(9);a$(x/100):next
  40. 400 ifa=6thenforx=1000to9000step1000:printtab(3);x;tab(9);a$(x/100):next
  41. 410 ifa=6thenprinttab(3);"10000";tab(9);a$(100)
  42. 420 ifa=6thengoto520
  43. 430 ifm$="p"thengosub1940:goto470
  44. 440 ifa=2ora=8thenforx=10 to 90 step 10 :printtab(4);x;tab(9);a$(x/10):next
  45. 450 ifa=2ora=8thenforx=100to 900step 100:printtab(3);x;tab(9);a$(x/10):next
  46. 460 ifa=2ora=8thenprinttab(3);"1000";tab(9);a$(100)
  47. 470 ifa=2ora=8thener=er*10:goto520
  48. 480 ifm$="p"thengosub2000:goto520
  49. 490 forx=1to9:printtab(4);x;tab(9);a$(x):next
  50. 500 forx=10to90step10:printtab(3);x;tab(9);a$(x):next
  51. 510 printtab(3);"100";tab(9);a$(100)
  52. 520 ifm$="p"andr$="a"thengoto670
  53. 530 ifa=6thener=er*100
  54. 540 ifr$="a"then690
  55. 550 ifr$="c"thenforxz=1to22:print"[145]";:nextxz
  56. 560 forx=1to9:cu(x)=x*er:gosub840:gosub930:next
  57. 570 forx=10to100step10:cu(x)=x*er:gosub840:gosub930:next
  58. 580 ifm$="p"thengosub2060:goto670
  59. 590 ifr$="c"then610
  60. 600 printchr$(147)
  61. 610 printtab(20-len(n$(a))+h);n$(a)
  62. 620 printtab(h+6);"$";tab(20-len(c$)+h);c$
  63. 630 printtab(h+3);:fori=1to17:print"-";:nexti:print
  64. 640 forx=1to9:printtab(h+5);x;tab(h+10);a$(x):next
  65. 650 forx=10to90step10:printtab(h+4);x;tab(h+10);a$(x):next
  66. 660 printtab(h+4);"100";tab(h+10);a$(100)
  67. 670 close4
  68. 680 ifm$="p"thenprint""
  69. 690 print"[208]ress space bar to continue";
  70. 700 poke204,0:poke207,0:getx$:ifx$=""then700
  71. 710 poke204,1
  72. 720 printchr$(147)
  73. 730 print"[195]alculate another rate? ";
  74. 740 poke204,0:poke207,0:getx$:ifx$=""then740
  75. 750 poke204,1:printx$
  76. 760 ifx$="y"then1140
  77. 770 ifx$="n"then800
  78. 780 ifx$<>"y"orx$<>"n"thenzz=1:zy=1:gosub1640:goto730
  79. 790 :
  80. 800 print"[147]load"chr$(34)"payload"chr$(34)",8":print"run"
  81. 810 poke631,13:poke632,13:poke198,2:end
  82. 820 rem decimal places and spacing
  83. 830 :
  84. 840 p=100
  85. 850 cu(x)=int((cu(x))*p+.05)/p
  86. 860 a$(x)=str$(cu(x))
  87. 870 ifint(cu(x))=cu(x)thena$(x)=a$(x)+".00"
  88. 880 ifcu(x)=.1orcu(x)=.2orcu(x)=.3or(x)=.4orcu(x)=.5orcu(x)=.6then910
  89. 890 ifcu(x)=.7orcu(x)=.8orcu(x)=.9then910
  90. 900 ifmid$(a$(x),len(a$(x))-2,1)="."thenreturn
  91. 910 a$(x)=a$(x)+"0"
  92. 920 return
  93. 930 iflen(a$(x))=2thena$(x)="        "+a$(x)
  94. 940 iflen(a$(x))=3thena$(x)="       "+a$(x)
  95. 950 iflen(a$(x))=4thena$(x)="      "+a$(x)
  96. 960 iflen(a$(x))=5thena$(x)="     "+a$(x)
  97. 970 iflen(a$(x))=6thena$(x)="    "+a$(x)
  98. 980 iflen(a$(x))=7thena$(x)="   "+a$(x)
  99. 990 iflen(a$(x))=8thena$(x)="  "+a$(x)
  100. 1000 iflen(a$(x))=9thena$(x)=" "+a$(x)
  101. 1010 return
  102. 1020 :
  103. 1030 rem establish parameters
  104. 1040 :
  105. 1050 printchr$(147):printchr$(129):printtab(2)"[198][207][210][197][201][199][206][160][195][213][210][210][197][206][195][217][160][195][207][206][214][197][210][211][201][207][206][160][208][210][207][199][210][193][205]"
  106. 1060 printchr$(144)
  107. 1070 printtab(18)"by"
  108. 1080 printtab(10)"[205]ichael [193]. [199]ranger"
  109. 1090 printtab(5)"[212]ranslated by [196]onna [203]. [215]oody"
  110. 1100 printtab(6)"[208]ress space bar to continue";
  111. 1110 printtab(35):poke204,0:poke207,0:getz$
  112. 1120 ifz$=""then1110
  113. 1130 poke204,1
  114. 1140 printchr$(147):print"[198]or what currency do you want a table?"
  115. 1150 print
  116. 1160 forx=1to9:print" ";x;". ";n$(x);:printtab(20)m$(x):nextx
  117. 1170 forx=10to12:printx;". ";n$(x);:printtab(20)m$(x):nextx
  118. 1180 print:poke 19,32:input"[197]nter selection: ";x$:print
  119. 1190 a=val(x$)
  120. 1200 ifa<1ora>12thenzz=15:zy=14:gosub1640:goto1180
  121. 1210 ifa=1thenc$=m$(1):goto1380
  122. 1220 ifa=2thenc$=m$(2):goto1380
  123. 1230 ifa=3thenc$=m$(3):goto1330
  124. 1240 ifa=4thenc$=m$(4):goto1380
  125. 1250 ifa=5thenc$=m$(5):goto1380
  126. 1260 ifa=6thenc$=m$(6):goto1380
  127. 1270 ifa=7thenc$=m$(7):goto1380
  128. 1280 ifa=8thenc$=m$(8):goto1380
  129. 1290 ifa=9thenc$=m$(9):goto1380
  130. 1300 ifa=10thenc$=m$(10):goto1380
  131. 1310 ifa=11thenc$=m$(11):goto1380
  132. 1320 ifa=12theninput"[197]nter the currency: ";c$:goto1380
  133. 1330 printchr$(147)
  134. 1340 ifa=3thenprint:print"[215]hat is the exchange rate?":print
  135. 1350 input"1 pound = $[160]";er$:er=val(er$):print:print
  136. 1360 ifer<=0thenzz=4:zy=3:gosub1640:goto1350
  137. 1370 goto1430
  138. 1380 printchr$(147)
  139. 1390 print:print"[215]hat is the exchange rate?"
  140. 1400 print:print"$1.00 =             ";c$
  141. 1410 input"[145]";er$:er=val(er$):print:print
  142. 1420 ifer<=0thenzz=4:zy=0:gosub1640:goto1390
  143. 1430 printtab(5)"[196]o you want to see"
  144. 1440 print
  145. 1450 printtab(10);"[193].  ";c$;" to $"
  146. 1460 printtab(10)"[194].  $ to ";c$
  147. 1470 printtab(10)"[195].  [194]oth":print:print:print
  148. 1480 r$="":h=0
  149. 1490 print"[197]nter selection: ";r$;
  150. 1500 poke204,0:poke207,0:getr$:ifr$=""then1500
  151. 1510 poke204,1:printr$
  152. 1520 ifr$="a"orr$="b"orr$="c"then1540
  153. 1530 zz=13:zy=13:gosub1640:goto1480
  154. 1540 m$="":print"<[211]>creen or <[208]>rinter[160]";m$;
  155. 1550 poke204,0:poke207,0:getm$:ifm$=""then1550
  156. 1560 poke204,1:printm$
  157. 1570 ifm$="s"orm$="p"then1590
  158. 1580 zz=17:zy=14:gosub1640:goto1540
  159. 1590 ifr$="c"thenh=18
  160. 1600 goto240
  161. 1610 :
  162. 1620 rem error trapping response
  163. 1630 :
  164. 1640 forxz=1to20-zz:print"";:nextxz
  165. 1650 print"[211]orry.  [217]ou made an incorrect entry     [208]lease re-enter."
  166. 1660 forxz=1to23-zy:print"[145]";:nextxz
  167. 1670 return
  168. 1680 :
  169. 1690 rem turn on printer
  170. 1700 rem if you want special type on printout, enter commands here
  171. 1710 :
  172. 1720 :
  173. 1730 open4,4,7
  174. 1740 return
  175. 1750 data"[193]ustrian","[194]elgian","[194]ritish","[196]anish","[198]rench","[201]talian","[196]utch"
  176. 1760 data"[211]panish","[211]wedish","[211]wiss","[215]est [199]erman","[207]ther"
  177. 1770 data"[211]chilling","[198]rancs","[208]ounds","[203]rone","[198]rancs","[204]ira","[199]uilders"
  178. 1780 data"[208]esetas","[203]rone","[198]rancs","[205]arks"
  179. 1790 :
  180. 1800 rem send to printer
  181. 1810 :
  182. 1820 print#4
  183. 1830 print#4
  184. 1840 print#4,chr$(16)"02"n$(a)
  185. 1850 print#4,chr$(16)"02"c$;chr$(16)"16""$"
  186. 1860 print#4,"  -----------------"
  187. 1870 return
  188. 1880 ifa=6thenforx=100to900step100:print#4,chr$(16)"04"x;
  189. 1890 print#4,chr$(16)"09"a$(x/100):next
  190. 1900 ifa=6thenforx=1000to9000step1000:print#4,chr$(16)"03"x;
  191. 1910 ifa=6thenprint#4,chr$(16)"09"a$(x/100):next
  192. 1920 ifa=6thenprint#4,chr$(16)"03""10000";chr$(16)"09"a$(100)
  193. 1930 return
  194. 1940 ifa=2ora=8thenforx=10to90step10:print#4,chr$(16)"04"x;
  195. 1950 ifa=2ora=8thenprint#4,chr$(16)"09"a$(x/10):next
  196. 1960 ifa=2ora=8thenforx=100to900step100:print#4,chr$(16)"03"x;
  197. 1970 ifa=2ora=8thenprint#4,chr$(16)"09"a$(x/10):next
  198. 1980 ifa=2ora=8thenprint#4,chr$(16)"03""1000";chr$(16)"09"a$(100)
  199. 1990 return
  200. 2000 forx=1to9:print#4,chr$(16)"04"x;chr$(16)"09"a$(x):next
  201. 2010 forx=10to90step10
  202. 2020 print#4,chr$(16)"03"x;
  203. 2030 print#4,chr$(16)"09"a$(x):next
  204. 2040 print#4,chr$(16)"03""100";chr$(16)"09"a$(100)
  205. 2050 return
  206. 2060 print#4:print#4:print#4
  207. 2070 cmd4:printtab(20-len(n$(a)));n$(a);
  208. 2080 print#4,chr$(16)"06""$";
  209. 2090 cmd4:printtab(20-len(c$));c$
  210. 2100 print#4,chr$(16)"03""------------------"
  211. 2110 forx=1to9:print#4,chr$(16)"05"x;chr$(16)"10"a$(x):next
  212. 2120 forx=10to90step10